package com.uglygeeker.rest;


import com.github.pagehelper.PageInfo;
import com.uglygeeker.entity.Area;
import com.uglygeeker.service.IAreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by tanxw on 2016/12/9.
 */
@RestController
@RequestMapping("area")
public class AreaController {

    @Autowired
    private IAreaService areaService;

    @RequestMapping("info")
    public List<Area> areaList(){
        return areaService.getAreaList();
    }

    @RequestMapping("page")
    public PageInfo<Area> areaList(int pageNum, int pageSize){
        return areaService.getAreaByPage(pageNum,pageSize);
    }
}
